using System;
using UnityEngine;
/// <summary>
/// 唯一扩展
/// </summary>
public static class HFUniqueExtend
{
    #region  UniqueHashCode 字符串唯一HashCode值
    /*
    * DebugLog.Log("hash: " + "8@".GetHashCode().ToString() + ", " + "7_".GetHashCode().ToString())
    * 小概率事件，两个字符串HashCode值一致         
    */
    /// <summary>
    /// 字符串唯一HashCode值
    /// </summary>
    /// <param name="_str">字符</param>
    /// <returns>HashCode</returns>
    public static int HFUniqueHashCode(this string _str)
    {
        return _str.ToUpper().HFMD5().GetHashCode();
    }
    #endregion

    #region UniqueHex 获得字符串唯一十六进制字符串
    /// <summary>
    /// 获得字符串唯一十六进制字符串
    /// </summary>
    /// <param name="_str">字符</param>
    /// <returns>十六进制字符串</returns>
    public static string HFUniqueHex(this int _value)
    {
        return _value.ToString("X2").ToUpper();
    }
    #endregion    
}